# Maintainer: Peter Budai <peterbudai@hotmail.com>

_realname=sphinxcontrib-devhelp
pkgbase=mingw-w64-python3-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=1.0.1
pkgrel=2
pkgdesc="Sphinx extension which outputs Devhelp document (mingw-w64)"
arch=('any')
license=('BSD')
url="https://github.com/sphinx-doc/sphinxcontrib-devhelp"
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest")
source=("${_realname}-${pkgver}.tar.gz"::"https://files.pythonhosted.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('6c64b077937330a9128a4da74586e8c2130262f014689b4b89e2d08ee7294a34')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  ${MINGW_PREFIX}/bin/python3 setup.py build
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  ${MINGW_PREFIX}/bin/py.test || warning "test failed"
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python3 setup.py install -O1 --skip-build \
      --root="${pkgdir}" --prefix=${MINGW_PREFIX}

  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/python3-${_realname}/LICENSE
}
